﻿<?session_start();
if(!defined('sugarEntry'))define('sugarEntry', true);
/*********************************************************************************
module : vng sales marketing
author : hoanghd@vinagame.com.vn
********************************************************************************/
require_once('XTemplate/xtpl.php');
require_once('log4php/LoggerManager.php');
require_once('include/modules.php');
require_once('modules/ZT2Remit/ZT2Remit.php');

global $current_language;
global $app_strings;
global $app_list_strings;
global $theme;
$theme_path = 'themes/' . $theme . '/';
$image_path = $theme_path .'images/';
require_once($theme_path . 'layout_utils.php');
global $mod_strings;
global $current_user;


$_type =$_POST['tp'];
$_id =$_POST['id'];

//$_rand =$_POST['rnd']!=''?$_POST['rnd']:$_GET['rnd'];
$fnc = new FNC();


$seed = new ZT2Remit_Ext();

// kiem tra quyen access 
if ($seed->ACLAccess('view')) {
    
    
	ob_start();
	if ($_type=='epmtt_dl')
	{
			$seed->email_template_import();	
			die();
	}	
	else if ($_type=='get_ef_config_add_form'){	
	//	$_mod	=	$_POST['mod'];
	//	$_year	=	$_POST['year'];			
	//	$_id	=	_get('id');
	//	$_token =	_get('token');
			
	//if ($seed->ACL_Page(4,'List','ePMTTConfig')){
	  	if (1==1){ 
	$list_form = new XTemplate('modules/ZT2Remit/d.html');	
           
    $msg='';
    
		if ($_id !='')
        {
                
                
                
				$sSQL="set ANSI_NULLS OFF; set ANSI_WARNINGS OFF; usp_ZT2_Remit_be_PlayingTime_Detail_List  '".$_id."'";		
			
				//$seed->ws_debug($sSQL);		
                	//die( $sSQL);
                    //error here		
				$result = $seed->db->query($sSQL, true, "Query failed");
               // $result = $this->db->query($sSQL, true, "Query failed");	
               		
				while ($aR = $seed->db->fetchByAssoc($result))
				{
					
					 $_recordDate = $aR['RecordDate'];                    
                     $_acountPM = $aR['CSMID']; 				
                     $_pcName = $aR['PCName'];
                   	 $_playingTime = $aR['PlayingTime'];
                     
                    $msg.='<tr>';
                    $msg.='<td  style="text-align:left">'.$STT.'</td>';                    
                    $msg.='<td  style="text-align:left">'.$fnc->date2vndate($_recordate,false).'</td>';
                    $msg.='<td  style="text-align:left">'.$_pcName.'</td>';
                    $msg.='<td  style="text-align:left">'.$_playingTime.'</td>';      
                    $msg.='</tr>';
				
				
				}                	
			
			}

			$list_form->assign('gridview',$msg);


			$list_form->parse('main');
			$info = $list_form->out_return('main');	
		}else{
			$info = 'Bạn không có quyền truy cập vào trang này !';
		}
		die($info);		
		//$info = $out->out_return('main');
		
		//echo $out;
		die();	
	}
	else{
		sugar_die('You do not have access to this area. Contact your site administrator to obtain access.');	
	}
	




	
	ob_end_flush();
} else {
	ACLController::displayNoAccess();
	sugar_die('');
}

class ZT2Remit_Ext  extends ZT2Remit
{
    
    
    
}

?>